package com.example.controller;

import com.example.common.Result;
import com.example.entity.MbtiType;
import com.example.service.MbtiTypeService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/mbti")
public class MbtiTypeController {
    @Resource
    private MbtiTypeService mbtiTypeService;
    @GetMapping("/{type}")
    public Result getByType(@PathVariable String type) {
        MbtiType mbtiType = mbtiTypeService.getByType(type);
        return Result.success(mbtiType);
    }
}
